<%@ page import="java.sql.*"%>
<%@ include file="dbconn.jsp" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Transfer Amount</title>
<link href="/tros/menuMain.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width=100% bordercolor="#C6D4E1" bgcolor="#C6D4E1">
<tr><th scope="col"><div align="center"><h1 align="center"><font face="Times New Roman">Tros - Online Banking System </font></h1></div></th></tr>
</table>
<div id="overall" align="center">
<div id="dropdwn" align="center">
<ul>
<li><a href='custHome.jsp?value=<%=session.getAttribute( "currentID" )%>'>Home</a>
</li>
</ul>
<ul>
<li><a href='accountInfo.jsp?value=<%=session.getAttribute( "currentID" )%>'>Account</a>
<ul>
<li><a href='viewBalance.jsp?value=<%=session.getAttribute( "currentID" )%>'>View Balance</a></li>
<li><a href='viewTransaction.jsp?value=<%=session.getAttribute( "currentID" )%>'>View Transactions</a></li>
</ul>
</li>
</ul>
<ul>
<li><a href='transferMain.jsp?value=<%=session.getAttribute( "currentID" )%>'>Transfer</a>
<ul>
<li><a href='depositMain.jsp?value=<%=session.getAttribute( "currentID" )%>'>Deposit</a></li>
<li><a href='withdrawal.jsp?value=<%=session.getAttribute( "currentID" )%>'>Withdraw</a></li>
</ul>
</li>
</ul>
<ul>
<li><a href='creditCard.jsp?value=<%=session.getAttribute( "currentID" )%>'>Credit Card</a>
</li>
</ul>
<ul>
<li><a href='paybills.jsp?value=<%=session.getAttribute( "currentID" )%>'>Pay Bills</a>
</li>
</ul>
<ul>
<li><a href='investMain.jsp?value=<%=session.getAttribute( "currentID" )%>'>Investments</a>
<ul>
<li><a href='viewShareInv.jsp?value=<%=session.getAttribute( "currentID" )%>'>Current Shares</a></li>
<li><a href='viewFdInv.jsp?value=<%=session.getAttribute( "currentID" )%>'>Current Fixed Deposit</a></li>
</ul>
</li>
</ul>
<ul>
<li><a href='updatePer.jsp?value=<%=session.getAttribute( "currentID" )%>'>Update Personal Info</a>
<ul>
<li><a href='changePass.jsp?value=<%=session.getAttribute( "currentID" )%>'>Change Password</a></li>
</ul>
</li>
</ul>
<ul>
<li><a href='logout.jsp'>Log Out</a></li>
</ul>
<br class="flow" />
</div>
</div>
&nbsp;
&nbsp;
<fieldset>
<legend><b>Transfer</b></legend>
<h3 align=center> Transfer Amount Portal</h3>
<p align=center>Please select Transfer type and Account for Transfer </p>
<form name="transferform" action="TransferType" method="post">
<table width=50% align=center cellpadding=5 cellspacing=0 bgcolor="#D5FFD5">
<tr><td width="43%">&nbsp;</td>
<tr> 
<tr><td><div align="center"><b>Select Transfer Type </b></div></td><tr>
<tr><td>&nbsp;</td><tr>
<tr><td align="right"><input type="radio" name="type" value="withinBank" checked>Transfer within bank<br></td>
<td align="center"><input type="radio" name="type" value="othrBank">Transfer to other bank<br></td><tr>
<tr><td>&nbsp;</td><tr>
<tr>
<td><div align="right">Account </div></td>
<%
String SaccNo="";
String ChaccNo="";
try
{

Statement reqst = connect.createStatement();
ResultSet result =reqst.executeQuery("SELECT * FROM SAVACC WHERE CUSTOMERID="+session.getAttribute( "currentID" ));
while(result.next())
  {
      SaccNo=result.getString("SAVACCNO");   
  }	
result.close();  
reqst.close();

Statement reqst1 = connect.createStatement();
ResultSet result1 =reqst1.executeQuery("SELECT * FROM CHCKACC WHERE CUSTOMERID="+session.getAttribute( "currentID" ));
while(result1.next())
  {
      ChaccNo=result1.getString("CHCKACCNO"); 
  }	
result1.close();  
reqst1.close();
}catch(Exception e)
{
	System.out.println("--------------->"+e.getMessage());
}
%>
<td width="57%" bgcolor="#D5FFD5">
<select style="width: 220px;" name="accOption">
  <option value="'sav'+<%=SaccNo%>">Savings Account (<%=SaccNo%>)</option>
  <option value="'chq'+<%=ChaccNo%>">Chequing Account (<%=ChaccNo%>)</option>
</select>
</tr>
<tr><td width="43%">&nbsp;</td><tr>
<td colspan=2 align=center bgcolor="#D5FFD5"><button type="submit" name="transfer" value="transfer"><u>P</u>roceed to Transfer</button>
</tr>
<tr><td>&nbsp;</td></tr>
</table>
</form>
</fieldset>
</body>
</html>